/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.agenda.model.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Ronildo
 */
@Entity
@Table(name = "AM_TB_LOG_ACES")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "AmTbLogAces.findAll", query = "SELECT a FROM AmTbLogAces a"),
    @NamedQuery(name = "AmTbLogAces.findByNrSequAces", query = "SELECT a FROM AmTbLogAces a WHERE a.nrSequAces = :nrSequAces"),
    @NamedQuery(name = "AmTbLogAces.findByDhAces", query = "SELECT a FROM AmTbLogAces a WHERE a.dhAces = :dhAces")})
public class AmTbLogAces implements Serializable {
    private static final long serialVersionUID = 1L;
    
    @Id
    @Basic(optional = false)
    @Column(name = "NR_SEQU_ACES")
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator = "seq_AM_TB_LOG_ACES")
    @SequenceGenerator(name="seq_AM_TB_LOG_ACES", sequenceName = "seq_AM_TB_LOG_ACES")
    private Integer nrSequAces;
    
    @Basic(optional = false)
    @NotNull
    @Column(name = "DH_ACES")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dhAces;
    @JoinColumn(name = "CD_USUA", referencedColumnName = "CD_USUA")
    @ManyToOne(optional = false)
    private AmTbUsuaSist cdUsua;

    public AmTbLogAces() {
    }

    public AmTbLogAces(Integer nrSequAces) {
        this.nrSequAces = nrSequAces;
    }

    public AmTbLogAces(Integer nrSequAces, Date dhAces) {
        this.nrSequAces = nrSequAces;
        this.dhAces = dhAces;
    }

    public Integer getNrSequAces() {
        return nrSequAces;
    }

    public void setNrSequAces(Integer nrSequAces) {
        this.nrSequAces = nrSequAces;
    }

    public Date getDhAces() {
        return dhAces;
    }

    public void setDhAces(Date dhAces) {
        this.dhAces = dhAces;
    }

    public AmTbUsuaSist getCdUsua() {
        return cdUsua;
    }

    public void setCdUsua(AmTbUsuaSist cdUsua) {
        this.cdUsua = cdUsua;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nrSequAces != null ? nrSequAces.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AmTbLogAces)) {
            return false;
        }
        AmTbLogAces other = (AmTbLogAces) object;
        if ((this.nrSequAces == null && other.nrSequAces != null) || (this.nrSequAces != null && !this.nrSequAces.equals(other.nrSequAces))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.agenda.model.entity.AmTbLogAces[ nrSequAces=" + nrSequAces + " ]";
    }
    
}
